import request from '@/axios/axios'

// 三元组订单列表
export function getList(query) {
  return request({
    url: 'mqtt/triplets/order/page',
    method: 'post',
    data: query
  })
}

// 新增三元组订单
export function add(query) {
  return request({
    url: 'mqtt/triplets/order/add',
    method: 'post',
    data: query
  })
}

// 三元组数量统计
export function statistics() {
  return request({
    url: 'mqtt/triplets/order/statistics',
    method: 'get'
  })
}

// 删除三元组订单表
export function deleteTriplets(query) {
  return request({
    url: 'mqtt/triplets/order/delete',
    method: 'get',
    params: query
  })
}

// 三元组详情列表
export function devicetripletsinfo(query) {
  return request({
    url: 'mqtt/device/triplets/info/page',
    method: 'post',
    data: query
  })
}

// 三元组数据
export function getOrder(query) {
  return request({
    url: 'mqtt/triplets/order/get',
    method: 'get',
    params: query
  })
}

// 生成三元组
export function generate(query) {
  return request({
    url: 'mqtt/device/triplets/info/generate',
    method: 'post',
    data: query
  })
}

// 导出
export function exportTriplets(query) {
  return request({
    url: 'mqtt/device/triplets/info/export',
    method: 'post',
    data: query,
    responseType: 'blob' // 强制axios将响应视为一个BLOB
  })
}

// 删除三元组详情数据
export function deleteDetails(query) {
  return request({
    url: 'mqtt/device/triplets/info/delete',
    method: 'get',
    params: query
  })
}
